'use strict';

require.config({
    paths : {
        'angular' : '../lib/angular/1.3.0/angular',
        'angular-resource' : '../lib/angular/1.3.0/angular-resource',
        'angular-route' : '../lib/angular/1.3.0/angular-route',
        'bootstrap' : '../lib/bootstrap/3.1.1/js/bootstrap',
        'datepicker' : '../lib/datepicker/js/bootstrap-datepicker',
        'codemirror' : '../lib/codemirror/4.1/lib/codemirror',
        'codemirror-xml' : '../lib/codemirror/4.1/mode/xml/xml',
        'codemirror-javascript' : '../lib/codemirror/4.1/mode/javascript/javascript',
        'codemirror-sql' : '../lib/codemirror/4.1/mode/sql/sql',
        'codemirror-active-line' : '../lib/codemirror/4.1/addon/selection/active-line',
        'ztree' : '../lib/ztree/3.5/js/jquery.ztree.all-3.5',
        'highcharts' : '../lib/highcharts/4.0.1/highcharts',
        'bootstrap-switch' : '../lib/bootstrap-switch/3.0.1/js/bootstrap-switch',

        'services' : 'services',
        'controllers' : 'controllers',
        'filters' : 'filters',
        'directives' : 'directives'
    },
    // shim声明加载非规范的模块，exports表示模块外部调用时的名称，deps数组表明该模块的依赖性。
    shim : {
        'angular': {
            exports: 'angular'
        },
        'angular-route': {
            deps: [ 'angular' ]
        },
        'angular-resource': {
            deps: [ 'angular' ]
        },
        'codemirror-xml': {
            deps: [ 'codemirror-active-line' ]
        },
        'codemirror-javascript': {
            deps: [ 'codemirror-active-line' ]
        },
        'codemirror-sql': {
            deps: [ 'codemirror-active-line' ]
        }
    }
});


require([
    'angular',
    'angular-route',
    'angular-resource',
    'bootstrap',
    'app',
    'routes',
    'directives',
    'filters',
    'services',
    'controllers',
    'common/service/menuService',
    'common/controller/globalController',
    'common/controller/indexController',
    'common/controller/navController',
    'common/controller/breadcrumbController',
    'common/controller/leftController',
    'common/controller/pagedController'
], function(angular) {
    angular.bootstrap(document.documentElement, ['app']);
});